using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class Msg_QueueMap : EntityTypeConfiguration<Msg_Queue>
    {
        public Msg_QueueMap()
        {
            // Primary Key
            this.HasKey(t => t.Msg_Queue_Id);

            // Properties
            this.Property(t => t.Msg_Subject)
                .HasMaxLength(50);

            this.Property(t => t.Msg_content)
                .HasMaxLength(4000);

            this.Property(t => t.send_user)
                .HasMaxLength(50);

            this.Property(t => t.destination)
                .HasMaxLength(4000);

            // Table & Column Mappings
            this.ToTable("Msg_Queue");
            this.Property(t => t.Msg_Queue_Id).HasColumnName("Msg_Queue_Id");
            this.Property(t => t.Msg_Subject).HasColumnName("Msg_Subject");
            this.Property(t => t.Msg_content).HasColumnName("Msg_content");
            this.Property(t => t.rule_line_Id).HasColumnName("rule_line_Id");
            this.Property(t => t.alert_type_Id).HasColumnName("alert_type_Id");
            this.Property(t => t.send_user).HasColumnName("send_user");
            this.Property(t => t.send_time).HasColumnName("send_time");
            this.Property(t => t.destination).HasColumnName("destination");
            this.Property(t => t.total_num).HasColumnName("total_num");
            this.Property(t => t.priority).HasColumnName("priority");
        }
    }
}
